package javax;

import java.util.Scanner;

public class Edd {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        System.out.print("请输入一个字符串：");
        String s=sc.nextLine();
        char[] ch=s.toCharArray();

        System.out.print("请输入要查找的字符：");
        String s1 = sc.nextLine();
        char[] chars = s1.toCharArray();

        int count=0;
       int i = 0;
       int j =0 ;
       for (char obj:ch){
          if (chars[0]==obj){
              while (++i<ch.length && ++j<chars.length){
                  if (ch[i]==chars[++j] && j==chars.length){
                      System.out.println(i-j);
                  }
              }
              System.out.println(1);
          }
       }

        System.out.print("该字符串中包含"+count+"个"+s1);
        System.out.println(s1);
        System.out.println(ch);
    }
}
